package com.frank.oj.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.frank.model.entity.user.Role;
import com.frank.model.entity.user.UserRole;
import com.frank.oj.model.vo.UserRolesVO;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * @author frank
 * @Date 2023/12/17
 */
@Mapper
public interface UserRoleMapper extends BaseMapper<UserRole> {
    UserRolesVO getUserRoles(@Param("uid") String uid, @Param("username") String username);

    List<Role> getRolesByUid(@Param("uid") String uid);

    IPage<UserRolesVO> getAdminUserList(@Param("page") Page<UserRolesVO> page, @Param("keyword") String keyword);

    IPage<UserRolesVO> getUserList(@Param("page") Page<UserRolesVO> page, @Param("keyword") String keyword);
}
